package www.shuang.common.util;

import java.util.Random;

import org.springframework.stereotype.Component;

@Component("regexUtil")
public class RegexUtil
{
	public String randStr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
	/*生成随机字符串*/
	
	public String andString(int length){
		
		StringBuffer sb=new StringBuffer();
		Random random=new Random();
		for (int i = 0; i < length; i++)
		{
			int randCh=random.nextInt(this.randStr.length());
			sb.append(this.randStr.charAt(randCh));
			
		}
		return sb.toString();
	}
}
